<form action="" method="post" Name="frmlostpass">
	<input type="hidden" id="hdnaction" name="hdnaction" />
	<div class="title_bg_dangky">
         <p>Lấy lại mật khẩu</p>
    </div>
    <table width="100%" class="login_form" cellpadding="0" cellspacing="0">	
		<col width="25%"><col width="75%">
		<tr  style="height: 25px;">
			<td class="normal_label_net" for="txt_username">Tên đăng nhập<small class="small_starmark">*</small></td>
			<td><input Name="txt_username" id="txt_username" type="text" class="normal_textbox_net" message ="Chua nhap ten dang nhap!" value="<?php echo $this->username; ?>" optional="false"></td>					
		</tr>
		<tr style="height: 25px;">
			<td class="normal_label_net" >Nhập mã xác nhận <small class="small_starmark">*</small></td>
			<td><input Name="txt_registex" type="text" value="" onKeyDown="change_focus_on_firefox(document.forms['frmlostpass'],this,event)" class="normal_textbox_net" message = "Hay nhap ma xac nhan!" ></td>
		</tr>
        <tr style="height: 44px;">
			<td class="normal_label_net" valign="center">Mã xác nhận</td>
			<td>
				<div id="div_captcha" style="width:80%;display: inline;"></div>
				<span class="refresh-captcha" onclick="getcaptcha();" style="cursor: pointer;"></span>
			</td>
		</tr>
		<tr style="height: 50px;">
			<td></td>
			<td>
				<input type = "button" class = "add_large_button_net" value = "Đồng ý" onClick= "btn_register_update('');">
				<input type = "button" style = "margin-left:10px;" class = "add_large_button_net" value = "Quay lại" onclick="window.history.back()" >
			</td>
		</tr>
	</table>		
</form>
<style type="text/css">
	table.login_form tr td input{
		width: 60%;
	}
	table.login_form tr td input.add_large_button_net{ width: auto;}
</style>
<script language="JavaScript">
getcaptcha();
function getcaptcha(){
	var p_url = baseUrl + '/web/user/getcaptcha/';
	$.ajax({
		url: p_url,type: 'POST',dataType: 'html',
		success: function(data){
			if(data != ''){
				$('#div_captcha').html(data);
			}
		}
	});
}
function checkcaptcha(actionName){
	var p_url = baseUrl + '/web/user/checkcaptcha/';
	var v_input = document.frmlostpass.txt_registex.value;
	$.ajax({
		url: p_url,type: 'POST',dataType: 'html',
		data: '&v_input='+v_input,
		success: function(data){
			if(data != ''){
				if(data=='1'){
					$("#hdn_update").attr("value",1);
					actionUrl(actionName);				
				}else{
					alert("Mã xác nhận không đúng");	
					document.frmlostpass.txt_registex.focus();
					return false;				
				}
			}
		}
	});
}
set_focus(document.forms[0]);
function btn_register_update(actionName){	
	if (verify(document.forms["frmlostpass"])){
		document.getElementById('hdnaction').value = 'lostpass';
		checkcaptcha(actionName);
	}
}
</script>